﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using Macds.Core.Configuration;

namespace Macds.Test.Core.Configuration.Mocks
{
    public class ConnectionStringSection : ConfigurationSection
    {
        [ConfigurationProperty("ConnectionStrings", IsRequired = true),
        ConfigurationCollection(typeof(GenericElementCollection<CustomSettingElement>), AddItemName = "database", ClearItemsName = "clear", RemoveItemName = "remove")]
        public GenericElementCollection<CustomSettingElement> Databases
        {
            get { return (GenericElementCollection<CustomSettingElement>)this["ConnectionStrings"]; }
            set { this["ConnectionStrings"] = value; }
        }

        public static ConnectionStringSection Load()
        {
            return (ConnectionStringSection)System.Configuration.ConfigurationManager.GetSection("Databases");
        }
    }
}
